package com.example.administrator.ksf_zty.MaterialActivity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import com.example.administrator.ksf_zty.Activity.MainActivity;
import com.example.administrator.ksf_zty.R;
import com.example.administrator.ksf_zty.util.BaseActivity;
import com.example.administrator.ksf_zty.util.TitleUtils;

public class MaterialMenuActivity extends BaseActivity {

    ImageButton back;
    Button titleButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_material_menu);
        SetTitle();
        SetOnClick();
    }

    //给按钮设置事件
    private void SetOnClick() {
        //退回供应商
        Button btnMaterialSupplierBack = (Button) findViewById(R.id.btnMaterialSupplierBack);
        btnMaterialSupplierBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MaterialMenuActivity.this, MaterialSupplierBackActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });
        //物料关企出库扫描
        Button btnMaterialOut = (Button) findViewById(R.id.btnMaterialOut);
        btnMaterialOut.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MaterialMenuActivity.this, MaterialOutActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });

        //物料调拨出库扫描
        Button btnMaterialDB = (Button) findViewById(R.id.btnMaterialDB);
        btnMaterialDB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MaterialMenuActivity.this, MaterialDBActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });

        //生产备料出库扫描
        Button btnMaterialBL = (Button) findViewById(R.id.btnMaterialBL);
        btnMaterialBL.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MaterialMenuActivity.this, MaterialBLActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });

        //生产退料入库扫描
        Button btnMaterialBack = (Button) findViewById(R.id.btnMaterialBack);
        btnMaterialBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MaterialMenuActivity.this, MaterialBackActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });

        //.返回
        Button material_menubtnCancel = (Button) findViewById(R.id.material_menubtnCancel);
        material_menubtnCancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MaterialMenuActivity.this, MainActivity.class);
                intent.putExtra("name", "");//传参数
                startActivity(intent);
            }
        });

    }


    //设置Title
    private void SetTitle() {
        back = (ImageButton) findViewById(R.id.back);
        titleButton = (Button) findViewById(R.id.titleButton);
        //设置标题(第三个参数是标题文字，直接替换""内容即可，第五个参数是标题右边按钮文字，第六个参数是设置是否显示返回按钮)
        TitleUtils.setTitle(this, R.id.title_sys_set, "物料管理菜单页面", this,
                "", true);
        //返回按钮事件
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}
